# coding: utf-8
import os

sub = "coco2014"

IMAGE_DIR = "~/dataset/voc_road/{}/JPEGImages/".format(sub)
IMAGE_DIR = os.path.expanduser(IMAGE_DIR)
out_fp = "~/dataset/voc_road/{}/ImageSets/Main/trainval.txt".format(sub)
out_fp = os.path.expanduser(out_fp)

fp = os.listdir(IMAGE_DIR)

out = [os.path.splitext(i.strip())[0] for i in fp]

with open(out_fp, "w") as f:
    for i in out:
        f.write(i + "\n")

print("done")